<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
    html *{
      padding: 0;
      margin: 0;
    }
  </style>
</head>
<body>
  <style>
    .flex {
      display: flex;
      width: 300px;
      height: 300px;
      background: #ccc;
      margin-bottom: 5px;
    }
    .flex p {
      margin: auto;
    }
  </style>
  <div class="flex">
    <p>content</p>
  </div>
  <style>
    .flex2 {
      display: flex;
      width: 300px;
      height: 300px;
      background: #ccc;
      align-items: center;
      justify-content: center;
      margin-bottom: 5px;
    }
  </style>
  <div class="flex2">
    <p>content</p>
  </div>
  <style>
    .position {
      position: relative;
      width: 300px;
      height: 300px;
      background: #ccc;
    }
    .position p {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translateX(-50%) translateY(-50%);
    }
  </style>
  <div class="position">
    <p>content</p>
  </div>
</body>
</html>